﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded
#pragma once
#include "GcmpDevService.h"
#include "LogBase.h"

namespace gcmp
{
    // 记录Dump信息
    class DumpLog : public LogBase
    {
    public:
        // 创建失败返回nullptr
        static OwnerPtr<DumpLog> CreateInstance(const std::wstring& logsFolder, const std::wstring& fileNameWithoutExt);

        // 输出text。simplified为true表示使用简化格式；默认为false
        void LogDumpLine(const std::wstring& text, bool simplified = false);
        void LogDumpLineToSpecialFile(const std::wstring& file, const std::wstring& text, bool simplified = false);
        ~DumpLog(void);

    protected:
        DumpLog(const std::wstring& appConfigKey);
    };

    // 记录日志运行中Dump信息
    class JournalDumpLog : public DumpLog
    {
    public:
        // 创建失败返回nullptr
        static OwnerPtr<JournalDumpLog> CreateInstance(const std::wstring& logsFolder, const std::wstring& fileNameWithoutExt);

        ~JournalDumpLog(void);

    protected:
        JournalDumpLog(const std::wstring& appConfigKey);
    };

    // 记录日志
    class JournalLog : public LogBase
    {
    public:
        // 创建失败返回nullptr
        static OwnerPtr<JournalLog> CreateInstance(const std::wstring& logsFolder, const std::wstring& fileNameWithoutExt);

        // 输出一行类型为logType的text内容
        void LogbmpLine(LogTypeOfLogManager logType, const std::wstring& text);

        //添加默认注释模板
        void LogDefaultTemplateNote();

        ~JournalLog(void);

    protected:
        JournalLog(const std::wstring& appConfigKey);
    };

    // 记录详细的日志
    class JournalFullLog : public JournalLog
    {
    public:
        // 创建失败返回nullptr
        static OwnerPtr<JournalFullLog> CreateInstance(const std::wstring& logsFolder, const std::wstring& fileNameWithoutExt);

        // 输出一行类型为logType的详细内容text
        void LogbmpFullLine(LogTypeOfLogManager logType, const std::wstring& text);

        ~JournalFullLog(void);

    protected:
        JournalFullLog(const std::wstring& appConfigKey);
    };

    // 记录数据一致性检测结果信息
    class ConsistencyDetectLog : public LogBase
    {
    public:
        // 创建失败返回nullptr
        static OwnerPtr<ConsistencyDetectLog> CreateInstance(const std::wstring& logsFolder, const std::wstring& fileNameWithoutExt);

        // 输出text。simplified为true表示使用简化格式；默认为false
        void LogConsistencyDetectLine(const std::wstring& text, bool simplified = false);

        ~ConsistencyDetectLog(void);

    protected:
        ConsistencyDetectLog(const std::wstring& appConfigKey);
    };
}
